package com.cms.admin.service.common.impl;

import com.cms.admin.mapper.IHisIMMessageMapper;
import com.cms.admin.model.IHisIMMessage;
import com.cms.admin.model.IHisIMMessageExt;
import com.cms.admin.model.PageBean;
import com.cms.admin.service.common.FeedbackListService;

import java.util.List;
/**
 * Created by Faroe on 17/5/15.
 */
public class FeedbackListServiceImpl implements FeedbackListService{
    private IHisIMMessageMapper messageMapper;

    @Override
    public List<IHisIMMessageExt> queryFeedbackList(PageBean page, IHisIMMessageExt example){
        int count=getRowCount(example);
        page.setAllRow(count);
        example.setOffset(page.getOffset());
        example.setPageSize(page.getPageSize());
        return messageMapper.selectByCondition(example);
    }


    @Override
    public int getRowCount(IHisIMMessageExt example) {
        return messageMapper.countByCondition(example);
    }


    //
    public IHisIMMessageMapper getMessageMapper() {
        return messageMapper;
    }

    public void setMessageMapper(IHisIMMessageMapper messageMapper) {
        this.messageMapper = messageMapper;
    }
}
